﻿using Microsoft.AspNetCore.Http;
using Simple.Repository.Models.ClassRoom;

namespace Simple.Services;

public class ClassAlbumMoveCreateOrUpdateModel : ModelBase
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 描述
    /// </summary>
    public string? Describe { get; set; }

    /// <summary>
    /// 标签
    /// </summary>
    public string? Tags { get; set; }

    /// <summary>
    /// 小朋友id集合
    /// </summary>
    public List<Guid>? ChildIdList { get; set; }

    /// <summary>
    /// 班级id
    /// </summary>
    public Guid? ClassId { get; set; }

    /// <summary>
    /// 图片idjihe 
    /// </summary>
    public List<Guid>? ImageIdList { get; set; }
    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<ClassAlbum, ClassAlbumMoveCreateOrUpdateModel>();

        profile.CreateMap<ClassAlbumMoveCreateOrUpdateModel, ClassAlbum>();
    }
}

public class ClassAlbumCreateOrUpdateModel : ModelBase
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 描述
    /// </summary>
    public string? Describe { get; set; }

    /// <summary>
    /// 标签
    /// </summary>
    public string? Tags { get; set; }

    /// <summary>
    /// 小朋友id集合
    /// </summary>
    public List<Guid>? ChildIdList { get; set; }

    /// <summary>
    /// 班级id
    /// </summary>
    public Guid? ClassId { get; set; }

    /// <summary>
    /// 图片
    /// </summary>
    public List<IFormFile>? ImageList { get; set; }

    /// <summary>
    /// 删除图片id（Images.Id）
    /// </summary>
    public List<Guid>? DeleteImg { get; set; }

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<ClassAlbum, ClassAlbumCreateOrUpdateModel>();

        profile.CreateMap<ClassAlbumCreateOrUpdateModel, ClassAlbum>();
    }
}

public class ClassAlbumOutputModel : ModelBase
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; } = null;
    /// <summary>
    /// 描述
    /// </summary>
    public string? Describe { get; set; }

    /// <summary>
    /// 标签
    /// </summary>
    public string? Tags { get; set; }

    /// <summary>
    /// 发布人姓名
    /// </summary>
    public string? CreateUserName { get; set; }

    /// <summary>
    /// 发布人Id
    /// </summary>
    public Guid? CreatedUserId { get; set; }

    /// <summary>
    /// 发布时间
    /// </summary>
    public DateTime? CreatedTime { get; set; }

    /// <summary>
    /// 小朋友id集合
    /// </summary>
    public List<string>? ChildIdList { get; set; }

    /// <summary>
    /// 小孩id
    /// </summary>
    public string? ChildId { get; set; }

    /// <summary>
    /// 班级id
    /// </summary>
    public Guid? ClassId { get; set; }

    /// <summary>
    /// 班级名
    /// </summary>
    public string? ClassName { get; set; }

    /// <summary>
    /// 图片
    /// </summary>
    public List<ClassAlbumImage>? Images { get; set; }

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<ClassAlbum, ClassAlbumOutputModel>();

        profile.CreateMap<ClassAlbumOutputModel, ClassAlbum>();
    }
}

public class ClassAlbumQueryPageInputModel : PageInputModel
{
    /// <summary>
    /// 关键字内容(标签)
    /// </summary>
    public string? ContentKey { get; set; }

    /// <summary>
    /// 班级Id
    /// </summary>
    public Guid? ClassId { get; set; }

    /// <summary>
    /// 孩子id
    /// </summary>
    public Guid? ChildId { get; set; }

    /// <summary>
    /// 是否是家长端
    /// </summary>
    public bool IsParent { get; set; } = false;
}
